﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Acid.GraphBuilder.Code;

namespace Acid.GraphBuilder
{
    public partial class Form1 : Form
    {
        private Device2D device;


        private void SetupControl()
        {
            this.device = new Device2D(this);
        }

        private void UpdateControl()
        {
            
        }
        private void RenderControl()
        {
            this.device.Clear(Color.Beige);

            this.device.Present();

        }

        private void DestroyControl()
        {
            this.device.Dispose();
        }

        #region Events

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.SetupControl();

            this.timer.Enabled = true;
        }

        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            this.timer.Enabled = false;

            this.DestroyControl();
        }


        private void timer_Tick(object sender, EventArgs e)
        {
            this.UpdateControl();

            this.RenderControl();
        }
        public Form1()
        {
            InitializeComponent();
        }

        #endregion

      
    }
}
